# Metview Macro

# read the netCDF file and print its list of variables
nc = read("fc_12.nc")
vars = variables(nc)
print(vars)

# set the current variable to be t2m and print its attributes
setcurrent(nc, 't2m')
atts = attributes(nc)
print(atts)

visualise_v2d = netcdf_visualiser(
    netcdf_plot_type          : "geo_matrix",
    netcdf_latitude_variable  : "latitude",
    netcdf_longitude_variable : "longitude",
    netcdf_value_variable     : "t2m",
    netcdf_data               : nc - 273.15
    )

shading_20_levels = mcont(
    legend                         : "on",
    contour                        : "off",
    contour_level_count            : 20,
    contour_label                  : "off",
    contour_shade                  : "on",
    contour_shade_method           : "area_fill",
    contour_shade_max_level_colour : "red",
    contour_shade_min_level_colour : "blue",
    contour_shade_colour_direction : "clockwise"
    )

title = mtext(text_line_1 : atts.long_name & ' C')

plot(visualise_v2d, shading_20_levels, title)
